using System;
using System.Collections.Generic;
using System.Text;
using System.Globalization;

namespace Instedd.Labs.Forms.Library
{
    static class Guard
    {
        public static void ArgumentNotNull(object value, string argumentName)
        {
            if (value == null)
            {
                throw new ArgumentNullException(argumentName);
            }
        }

        public static void ArgumentNotNullOrEmptyString(string value, string argumentName)
        {
            ArgumentNotNull(value, argumentName);
            if (value.Length == 0)
            {
                // TODO: Move to resources.
                throw new ArgumentException(String.Format(
                    CultureInfo.CurrentCulture,
                    "Argument {0} cannot be an empty string.",
                    argumentName));
            }
        }
    }
}
